<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:p="http://www.example.org/products" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
	<xsl:output method="html" />
	<xsl:param name="categoryName" />
	<xsl:template match="/">
		<html>
			<head>
				<title>Insert title here</title>
				<link type="text/css" rel="stylesheet" href="styles/style.css" />
			</head>
			<body>
				<div id="main">
					<div id="header">
						<h2>
							ProductStore
						</h2>	
					</div>
					<div id="content">
						<H2>
							<xsl:value-of select="$categoryName" />
						</H2>
						<H3>Subcategories:</H3>
						<table border="1">
							<tr>
								<td>Name</td>
								<td>Count</td>
							</tr>
							<xsl:apply-templates select="p:products/p:category[@name=$categoryName]/p:sub-category" />
						</table>
						<form method="POST" action="controller">
							<input type="hidden" name="command" value="categories" />
							<input type="submit" name="buttonBack" value="Back"	style="width: 150px;" />
						</form>
					</div>
					<div id="buffer">				
					</div>
				</div>
				<div id="footer">
					<p>Copyright &#169; EPAM 2012. All rights reserved.</p>
				</div>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="p:sub-category">
		<xsl:param name="subCategoryName" select="@name"/>
		<tr>
			<td width="250px">
				<a href="controller?command=goods&amp;categoryName={$categoryName}&amp;subCategoryName={$subCategoryName}">
					<xsl:value-of select="@name" />					
				</a>
			</td>
			<td align="center">
				<xsl:value-of select="count(p:good)" />
			</td>
		</tr>
		<br/>
	</xsl:template>
</xsl:stylesheet>